# import turtle
from turtle import *
from win32.win32api import GetSystemMetrics


def fw():
    fd(90)


def l():
    lt(90)


def r():
    rt(90)


def db():
    bk(90)


if __name__ == "__main__":
    # bgcolor("#660066")

    # GetSystemMetrics(0), GetSystemMetrics(1)
    # screensize(2000, 1500)
    k = Screen()

    shape("square")
    bgcolor("#330066")
    color('#660066', '#660066')
    delay(1000)
    # 监听键盘
    k.listen()
    k.onkeypress(fw, "Up")
    # k.onkeypress(db, "Down")
    k.onkeypress(l, "Left")
    k.onkeypress(r, "Right")
    i = 0
    while pos() < screensize():
        print(pos())
        fw()
    print("结束")
    done()